package com.cloud.sentinel.controller;

import com.alibaba.csp.sentinel.annotation.SentinelResource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author kangwen
 */
@RestController
public class SentinelController {

	@GetMapping("one")
	@SentinelResource(value = "one", blockHandlerClass = DefaultBlockHandler.class, blockHandler = "handlerException", fallbackClass = DefaultFallback.class, fallback = "fallback")
	public String one(@RequestParam(value = "param1", required = false) String param1) {
		return "one is ok " + param1;
	}
}
